/**
 * Generate code from /{{projectName}}-core/src/main/java/{{packageName}}/core/{{modules}}/domain/{{entities@SQL}}.java.hbs
 */
package cn.ibizlab.core.ad.domain;

import java.util.*;
import java.math.BigDecimal;
import cn.ibizlab.util.domain.IEntity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.*;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import org.springframework.util.*;
import org.springframework.data.annotation.*;
import cn.ibizlab.util.annotation.*;
import cn.ibizlab.util.enums.*;
import cn.ibizlab.util.domain.EntityMP;
import java.io.Serializable;
import lombok.*;
import lombok.experimental.Accessors;
import io.swagger.annotations.*;
import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.core.toolkit.IdWorker;

/**
 * GroupOfNames实体类[SysGroupOfNames]
 *
 * @author generator
 */
@Getter
@Setter
@NoArgsConstructor
@Accessors(chain = true)
@JsonIgnoreProperties(value = "handler")
@TableName(value = "SYS_GROUP_OF_NAMES", resultMap = "SysGroupOfNamesResultMap")
@ApiModel(value = "SYS_GROUP_OF_NAMES", description = "GroupOfNames")
public class SysGroupOfNames extends EntityMP implements Serializable
{

    /**
     * 标识
     */
    @Id
    @TableField(exist = false)
    @DEField(name = "id" , isKeyField = true)
    @JsonProperty("id")
    @JSONField(name = "id")
    @ApiModelProperty(value = "id", notes = "标识")
    private String id;

    /**
     * 名称
     */
    @TableField(value = "name" , exist = false)
    @DEField(name = "name")
    @JsonProperty("name")
    @JSONField(name = "name")
    @ApiModelProperty(value = "name", notes = "名称")
    private String name;

    /**
     * 类型
     */
    @TableField(value = "object_class" , exist = false)
    @DEField(name = "object_class" , dict = "Sys_group_of_names_type")
    @JsonProperty("object_class")
    @JSONField(name = "object_class")
    @ApiModelProperty(value = "object_class", notes = "类型")
    private String objectClass;

    /**
     * 逻辑有效标记
     */
    @TableField(value = "enabled" , exist = false)
    @TableLogic(value = "1" , delval = "0")
    @DEField(name = "enabled" , preType = DEPredefinedFieldType.LOGICVALID , logicval = "1" , logicdelval = "0")
    @JsonProperty("enabled")
    @JSONField(name = "enabled")
    @ApiModelProperty(value = "enabled", notes = "逻辑有效标记")
    private String enabled;

    /**
     * 上级标识
     */
    @TableField(value = "parent_id" , exist = false)
    @DEField(name = "parent_id")
    @JsonProperty("parent_id")
    @JSONField(name = "parent_id")
    @ApiModelProperty(value = "parent_id", notes = "上级标识")
    private String parentId;

    /**
     * DC
     */
    @TableField(value = "dc" , exist = false)
    @DEField(name = "dc")
    @JsonProperty("dc")
    @JSONField(name = "dc")
    @ApiModelProperty(value = "dc", notes = "DC")
    private String dc;

    /**
     * 描述
     */
    @TableField(value = "description" , exist = false)
    @DEField(name = "description")
    @JsonProperty("description")
    @JSONField(name = "description")
    @ApiModelProperty(value = "description", notes = "描述")
    private String description;

    /**
     * 排序
     */
    @TableField(value = "sort" , exist = false)
    @DEField(name = "sort")
    @JsonProperty("sort")
    @JSONField(name = "sort")
    @JsonSerialize(using = ToStringSerializer.class)
    @ApiModelProperty(value = "sort", notes = "排序")
    private Long sort;

    /**
     * Filter
     */
    @TableField(value = "filter" , exist = false)
    @DEField(name = "filter")
    @JsonProperty("filter")
    @JSONField(name = "filter")
    @ApiModelProperty(value = "filter", notes = "Filter")
    private String filter;

    /**
     * 组织机构标识
     */
    @TableField(value = "organization_id" , exist = false)
    @DEField(name = "organization_id")
    @JsonProperty("organization_id")
    @JSONField(name = "organization_id")
    @ApiModelProperty(value = "organization_id", notes = "组织机构标识")
    private String organizationId;

    /**
     * 部门标识
     */
    @TableField(value = "department_id" , exist = false)
    @DEField(name = "department_id")
    @JsonProperty("department_id")
    @JSONField(name = "department_id")
    @ApiModelProperty(value = "department_id", notes = "部门标识")
    private String departmentId;

    /**
     * 禁止选择
     */
    @TableField(value = "disabled" , exist = false)
    @DEField(name = "disabled")
    @JsonProperty("disabled")
    @JSONField(name = "disabled")
    @ApiModelProperty(value = "disabled", notes = "禁止选择")
    private BigDecimal disabled;

    /**
     * 设置 [名称]
     */
    public SysGroupOfNames setName(String name) {
        this.name = name;
        this.modify("name", name);
        return this;
    }

    /**
     * 设置 [类型]
     */
    public SysGroupOfNames setObjectClass(String objectClass) {
        this.objectClass = objectClass;
        this.modify("object_class", objectClass);
        return this;
    }

    /**
     * 设置 [上级标识]
     */
    public SysGroupOfNames setParentId(String parentId) {
        this.parentId = parentId;
        this.modify("parent_id", parentId);
        return this;
    }

    /**
     * 设置 [DC]
     */
    public SysGroupOfNames setDc(String dc) {
        this.dc = dc;
        this.modify("dc", dc);
        return this;
    }

    /**
     * 设置 [描述]
     */
    public SysGroupOfNames setDescription(String description) {
        this.description = description;
        this.modify("description", description);
        return this;
    }

    /**
     * 设置 [排序]
     */
    public SysGroupOfNames setSort(Long sort) {
        this.sort = sort;
        this.modify("sort", sort);
        return this;
    }

    /**
     * 设置 [Filter]
     */
    public SysGroupOfNames setFilter(String filter) {
        this.filter = filter;
        this.modify("filter", filter);
        return this;
    }

    /**
     * 设置 [组织机构标识]
     */
    public SysGroupOfNames setOrganizationId(String organizationId) {
        this.organizationId = organizationId;
        this.modify("organization_id", organizationId);
        return this;
    }

    /**
     * 设置 [部门标识]
     */
    public SysGroupOfNames setDepartmentId(String departmentId) {
        this.departmentId = departmentId;
        this.modify("department_id", departmentId);
        return this;
    }

    /**
     * 设置 [禁止选择]
     */
    public SysGroupOfNames setDisabled(BigDecimal disabled) {
        this.disabled = disabled;
        this.modify("disabled", disabled);
        return this;
    }

    /**
     * 复制当前对象数据到目标对象(粘贴重置)
     * @param targetEntity 目标数据对象
     * @param includeEmpty  是否包括空值
     * @param <T>
     * @return
     */
    @Override
    public <T> T pasteTo(T targetEntity, boolean includeEmpty) {
        super.pasteTo(targetEntity, includeEmpty);
        if(targetEntity instanceof IEntity) {
            IEntity entity = ((IEntity) targetEntity);
            entity.reset("id");
        }
        return targetEntity;
    }

}